<header id="topbar">
    <div class="topbar-left">
        <ol class="breadcrumb">
            <li class="crumb-active">
                <a href="<%= window.location.href %>">每日报表</a>
            </li>
        </ol>
    </div>
</header>
<section id="content" class="animated fadeIn">
    <div class="panel">
        <form class="form-horizontal" role="form">
            <div class="form-group">
                <div class="col-md-10">
                    <input type="text" id="dateFilter" class="form-control text-center" value="<%= options.dateRange[0] %> ~ <%= options.dateRange[1] %>">
                </div>
                <div class="col-md-1">
                    <input type="button" id="search" class="btn btn-primary btn-block form-control" value="提交">
                </div>
            </div>
        </form>
    </div>

    <div class="panel overflow">
        <table class="table table-striped fs13" id="main-list">
            <thead>
                <tr class="bg-light">
                    <th class="sortable" data-field="day">日期</th>
                    <th class="sortable" data-field="new_device">注册</th>
                    <th class="sortable" data-field="new_user">注册绑定</th>
                    <th class="sortable" data-field="active_register_user">绑定总数</th>
                    <th class="sortable" data-field="active_user">今日登录</th>
                    <th class="sortable" data-field="active_user_ios">今日ios登录</th>
                    <th class="sortable" data-field="active_user_android">今日android登录</th>
                    <th class="sortable" data-field="new_recharge_device_ratio">注充比例</th>
                    <th class="sortable" data-field="new_register_device_ratio">注绑比例</th>
                    <th class="sortable" data-field="new_recharge_ratio">绑充比例</th>
                    <th class="sortable" data-field="recharge_price">充值总数</th>
                    <th class="sortable" data-field="new_recharge_price">新用户充值</th>
                    <th class="sortable" data-field="old_recharge_price">老用户充值</th>
                    <th class="sortable" data-field="online_recharge_price">在线充值</th>
                    <th class="sortable" data-field="new_online_recharge_price">新用户在线充值</th>
                    <th class="sortable" data-field="old_online_recharge_price">老用户在线充值</th>
                    <th class="sortable" data-field="agent_recharge_price">代理充值</th>
                    <th class="sortable" data-field="new_agent_recharge_price">新用户代理充值</th>
                    <th class="sortable" data-field="old_agent_recharge_price">老用户代理充值</th>
                    <th class="sortable" data-field="recharge_user">充值人数</th>
                    <th class="sortable" data-field="new_recharge_user">新用户充值人数</th>
                    <th class="sortable" data-field="old_recharge_user">老用户充值人数</th>
                    <th class="sortable" data-field="online_recharge_user">在线充值人数</th>
                    <th class="sortable" data-field="new_online_recharge_user">新用户在线充值人数</th>
                    <th class="sortable" data-field="old_online_recharge_user">老用户在线充值人数</th>
                    <th class="sortable" data-field="agent_recharge_user">代理充值人数</th>
                    <th class="sortable" data-field="recharge_count">充值笔数</th>
                    <th class="sortable" data-field="online_recharge_count">在线充值笔数</th>
                    <th class="sortable" data-field="agent_recharge_count">代理充值笔数</th>
                    <th class="sortable" data-field="agent_import">代理进货</th>
                    <th class="sortable" data-field="agent_cost">代理充值金额</th>
                    <th class="sortable" data-field="average_recharge">人均充值</th>
                    <th class="sortable" data-field="recharge_rate">付费率</th>
                    <th class="sortable" data-field="withdraw_price">兑换</th>
                    <th class="sortable" data-field="withdraw_count">兑换人数</th>
                    <th class="sortable" data-field="play_user">活跃人数</th>
                    <th class="sortable" data-field="real_profit_rate">营收比</th>
                    <th class="sortable" data-field="real_profit">营收</th>
                    <th class="sortable" data-field="user_stay_2">帐号次留</th>
                    <th class="sortable" data-field="arpu">日arpu</th>
                    <th class="sortable" data-field="arppu">日arppu</th>
                    <th class="sortable" data-field="ltv7">7天LTV</th>
                    <th class="sortable" data-field="ltv14">14天LTV</th>
                    <th class="sortable" data-field="ltv30">30天LTV</th>
                    <th class="sortable" data-field="ltv60">60天LTV</th>
                </tr>
            </thead>
            <tbody class="admin-form">
                <% _.each(items, function(item){ %>
                    <tr>
                        <td><%= item.day %></td>
                        <td><%= item.new_device || 0 %></td>
                        <td><%= item.new_user || 0 %></td>
                        <td><%= item.active_register_user || 0 %></td>
                        <td><%= item.active_user || 0 %></td>
                        <td><%= item.active_user_ios || 0 %></td>
                        <td><%= item.active_user_android || 0 %></td>
                        <td><%= (item.new_recharge_device_ratio * 100).toFixed(2) || 0 %>%</td>
                        <td><%= (item.new_register_device_ratio * 100).toFixed(2) || 0 %>%</td>
                        <td><%= (item.new_recharge_ratio * 100).toFixed(2) || 0 %>%</td>
                        <td><%= ((item.recharge_price || 0) / 100).toFixed(2) %></td>
                        <td><%= ((item.new_recharge_price || 0) / 100).toFixed(2) %></td>
                        <td><%= ((item.old_recharge_price || 0) / 100).toFixed(2) %></td>
                        <td><%= ((item.online_recharge_price || 0) / 100).toFixed(2) %></td>
                        <td><%= ((item.new_online_recharge_price || 0) / 100).toFixed(2) %></td>
                        <td><%= ((item.old_online_recharge_price || 0) / 100).toFixed(2) %></td>
                        <td><%= ((item.agent_recharge_price || 0) / 100).toFixed(2) %></td>
                        <td><%= ((item.new_agent_recharge_price || 0) / 100).toFixed(2) %></td>
                        <td><%= ((item.old_agent_recharge_price || 0) / 100).toFixed(2) %></td>
                        <td><%= item.recharge_user || 0 %></td>
                        <td><%= item.new_recharge_user || 0 %></td>
                        <td><%= item.old_recharge_user || 0 %></td>
                        <td><%= item.online_recharge_user || 0 %></td>
                        <td><%= item.new_online_recharge_user || 0 %></td>
                        <td><%= item.old_online_recharge_user || 0 %></td>
                        <td><%= item.agent_recharge_user || 0 %></td>
                        <td><%= item.recharge_count || 0 %></td>
                        <td><%= item.online_recharge_count || 0 %></td>
                        <td><%= item.agent_recharge_count || 0 %></td>
                        <td><%= item.agent_import || 0 %></td>
                        <td><%= ((item.agent_cost || 0) / 100).toFixed(2) %></td>
                        <td><%= ((item.average_recharge || 0) / 100).toFixed(2) %></td>
                        <td><%= (item.recharge_rate * 100).toFixed(2) %>%</td>
                        <td><%= ((item.withdraw_price || 0) / 100).toFixed(2) %></td>
                        <td><%= item.withdraw_count || 0 %></td>
                        <td><%= item.play_user || 0 %></td>
                        <td><%= (item.real_profit_rate * 100).toFixed(2) %>%</td>
                        <td><%= ((item.real_profit || 0) / 100).toFixed(2) %></td>
                        <td><%= (item.user_stay_2 * 100).toFixed(2) %>%</td>
                        <td><%= item.arpu || 0 %></td>
                        <td><%= item.arppu || 0 %></td>
                        <td><%= item.ltv7 ? item.ltv7.toFixed(2) : 0 %></td>
                        <td><%= item.ltv14 ? item.ltv14.toFixed(2) : 0 %></td>
                        <td><%= item.ltv30 ? item.ltv30.toFixed(2) : 0 %></td>
                        <td><%= item.ltv60 ? item.ltv60.toFixed(2) : 0 %></td>
                    </tr>
                <% }) %>
            </tbody>
        </table>
    </div>
</section>
